#define _CRT_SECURE_NO_WARNINGS 
#include<stdio.h>

int int_cmp(const void* p1, const void* p2)
{
    return (*(int*)p1 - *(int*)p2);
}
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int i = 0;
    for (i = 0; i != n; i++)
    {
        nums1[m + i] = nums2[i];
    }
    qsort(nums1, m + n, sizeof(nums1[0]), int_cmp);
}


int removeElement(int* nums, int numsSize, int val) {
    int left = 0;
    for (int right = 0; right < numsSize; right++) {
        if (nums[right] != val) {
            nums[left] = nums[right];
            left++;
        }
    }
    return left;
}